import UserAPI from "@/services/ant-design-pro/user"
const { getUserList } = UserAPI;
export default {
    namespace: 'test',
    state: {
        test: []
    },
    effects: {
        *getUserList({ payload, callback }, { call, put, select }) {
            const test = yield select(state => state.test.test);
            let result = test;
            if (test.length <= 0) {
                result = yield call(getUserList)
            }
            yield put({
                type: 'reducers',
                test: result.data.value
            })
        }
    },
    reducers: {
        reducers(state, action) {
            return {
                ...state,
                ...action
            }
        }
    }
}